/*
 * ObjModel.h
 *
 */

#ifndef OBJMODEL_H_
#define OBJMODEL_H_

#include "Model3D.h"
#include "Level.h"
#include <vector>


/*contains material specifications and vectors of vertices
 * which define triangles to be rendered with this material*/
struct Material{
	char name[50];	//name of material
	float Ns;
	float Ka[4];	//ambient component
	float Kd[4];	//diffuse component
	float Ks[4];	//specular componenet
	float Ni;
	float d;
	int illum;
	char file[50];	//name of file with texture
	GLuint texture;	//texture

	std::vector<Vertex> vertices;
	std::vector<Vertex> normals;
	std::vector<Vertex2D> tex_vertices;
};


class ObjModel: public Model3D {
public:
	ObjModel();
	ObjModel(char *pathname);
	virtual ~ObjModel();

	void readOBJ(char *pathname);
	void readMTL(char *pathname);
	void renderGL();

protected:
	std::vector<Material> materials;
};

#endif /* OBJMODEL_H_ */
